import request from "../../utils/request"
const updateEmployee = (data) => {
    // 使用URLSearchParams来构建查询字符串
    // 更新员工
    return request({
      url: '/employee/update',
      method: 'post',
      data
    });
  }

const getEmployeeList=()=>{
    //获取员工列表
    return request({
        url: '/employee/list',
        method: 'get',
    })
}

const addEmployee = (data) => {
    // 添加员工
    return request({
        url: '/employee/add', // 正确地将查询字符串附加到URL上
        method: 'post',
        data
    });
}

const listEmployee = () => {
    // 查询已经离职的员工
    return request({
        url: '/employee/listLeave',
        method: 'get',
    });
}

const exportEmployee = () => {
    // 导出员工
    return request({
        url: '/employee/exportEmployees',
        method: 'get',
    });
}
const userRegister=(data)=>{
    //用户注册
    return request({
        url: '/user/register',
        method: 'post',
        data
    })
}

export {
    updateEmployee,
    getEmployeeList,
    addEmployee,
    listEmployee,
    userRegister,
    exportEmployee
}